package security

import (
	"sync"
)

// MalwareDetail 结构体
type MalwareDetail struct {
	// 恶意代码详细描述
	Description string `json:"description,omitempty" xml:"description,omitempty"`
	// 恶意代码风险级别: High-高 Low-低
	Level string `json:"level,omitempty" xml:"level,omitempty"`
	// 恶意代码名称
	Name string `json:"name,omitempty" xml:"name,omitempty"`
	// 恶意代码类型
	Type string `json:"type,omitempty" xml:"type,omitempty"`
}

var poolMalwareDetail = sync.Pool{
	New: func() any {
		return new(MalwareDetail)
	},
}

// GetMalwareDetail() 从对象池中获取MalwareDetail
func GetMalwareDetail() *MalwareDetail {
	return poolMalwareDetail.Get().(*MalwareDetail)
}

// ReleaseMalwareDetail 释放MalwareDetail
func ReleaseMalwareDetail(v *MalwareDetail) {
	v.Description = ""
	v.Level = ""
	v.Name = ""
	v.Type = ""
	poolMalwareDetail.Put(v)
}
